<?php

	$protocol  = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
	$path      = str_replace($_SERVER['DOCUMENT_ROOT'], '', str_replace('\\', '/', dirname(__FILE__)));
	$webSite   = $protocol . $_SERVER['SERVER_NAME'];
	$returnUrl = $protocol . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $path . "/returnUrl.php";

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<title>支付测试页面/Test payment page</title>
<style type="text/css">
td{
	height:20px
}
input[type="text"]
{
  width:450px;
  height:20px;
  display:block;
  margin-bottom:0px;
  font-family: Verdana, Arial;
}
.phead{
	text-align:center;
	font-size:14px;
	font-weight:bold;
	height:20px
}
.td3{
	text-align:center;
	color:red;
}
</style>
<script type="text/javascript">
//create Order Number
function S4() {
    return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
function guid() {
    return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}
function init(){
	 document.getElementById("orderNo").value = guid();
	 document.getElementById("userAgent").value = navigator.userAgent;
	 document.getElementById("ip").value = returnCitySN["cip"];
}
</script>
</head>
<body style="font-size:14px" onload="init()">
<div style="margin-top:20px">
<form action="sendBank.php" method="post" >
<table bgcolor="#000000" cellspacing="1" class="tableInfo" align="center" width="1120px">
<tr bgcolor="#ffffff">
	<td colspan="3" style="text-align:center;font-size:20px;font-weight:bold;height:40px">[直连支付测试案例] [Payment Interface Demo]</td>
</tr>
<tr bgcolor="#ffffff">
	<td width="320px" class="phead">[参数名][Parameter Name]</td>
	<td width="450px" class="phead">[参数值][Parameter Value]</td>
	<td width="150px" class="phead">Mark<span style="color:red">*</span>Required</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="3" style="text-align:center;font-weight:bold">[订单基本信息][Basic Order information]</td>
</tr>
<tr bgcolor="#ffffff">
<td>[商户编号][Merchant Number[merNo]</td>
<td><input type="text" name="merNo" value='67001'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[终端编号][Terminal Number][terNo]</td>
<td><input type="text" name="terNo" value='67001001'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[密钥][Encryption key][signKey]</td>
<td><input type="text" name="signKey" value='rB6t60l8Fkd'></td>
<td class="td3">只加密,不传输<br>Encrypt only, No transmit</td>
</tr>
<tr bgcolor="#ffffff">
<td>[订单号][Order Number][orderNo]</td>
<td><input type="text" name="orderNo" value="" id="orderNo"></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[订单总金额][Order Amount][orderAmount]</td> 
<td><input type="text" name="orderAmount" value='11'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[订单币种][Order Currency][orderCurrency]</td>
<td><input type="text" name="orderCurrency" value='USD'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[订单币种][Order Currency][orderCurrency]</td>
<td><input type="text" name="orderCurrency" value='USD'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[产品信息][Goods Info][goodsString]</td>
<td>
<textarea rows="4" cols="55" name="goodsInfo">
[{"gdNo":"Y0001","gdName":"pen","gdPrice":"2.5","gdQty":"2"}, {"gdNo":"Y0002","gdName":"iphone","gdPrice":"25.5","gdQty":"1"}]
</textarea>
</td>
<td class="td3">* </td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="3" style="text-align:center;font-weight:bold">[账单人信息][Card Holder Bill Information]</td>
</tr>
<tr bgcolor="#ffffff">
<td>[账单人国家][Card Holder Country][billCountry]</td>
<td><input type="text" name="billCountry" value='CA'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[账单人省份][Card Holder State][billState]</td>
<td><input type="text" name="billState" value='WA'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[账单人城市][Card Holder City][billCity]</td>
<td><input type="text" name="billCity" value='Toronto'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[账单人详细地址][Card Holder Address][billAddress]</td>
<td><input type="text" name="billAddress" value='226 street'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[持卡人账单人姓][Card Holder First Name][billFirstName]</td>
<td><input type="text" name="billFirstName" value='Mark'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[账单人名][Card Holder Last Name][billLastName]</td>
<td><input type="text" name="billLastName" value='Mark'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[账单人邮箱][Card Holder Email][billEmail]</td>
<td><input type="text" name="billEmail" value='cirey@yahoo.com'></td>
<td class="td3">*</td>
</tr>

<tr bgcolor="#ffffff">
<td>[账单人电话][Bill Telephone][billPhone]</td>
<td><input type="text" name="billPhone" value='1388888888'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[账单人邮编][Card Holder Zip][billZip]</td>
<td><input type="text" name="billZip" value='123456'></td>
<td class="td3">*</td>
</tr>

<tr bgcolor="#ffffff">
<td colspan="3" style="text-align:center;font-weight:bold">[收货人信息][Delivery Information]</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人国家][Delivery Country][shipCountry]</td>
<td><input type="text" name="shipCountry" value='US'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人省份][Delivery State][shipState]</td>
<td><input type="text" name="shipState" value='New York'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人城市][Delivery City][shipCity]</td>
<td><input type="text" name="shipCity" value='New York'></td> 
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人详细地址][Delivery Address][shipAddress]</td>
<td><input type="text" name="shipAddress" value='Manhattan'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人邮编][Delivery Zip][shipZip]</td>
<td><input type="text" name="shipZip" value='88888'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人邮箱][Delivery Email][shipEmail]</td>
<td><input type="text" name="shipEmail" value='shoping@gmail.com'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人电话][Delivery Telephone][shipPhone]</td>
<td><input type="text" name="shipPhone" value='188888888888'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人姓][Delivery Full Name][shipFirstName]</td>
<td><input type="text" name="shipFirstName" value='Jack li'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[收货人名][Delivery Full Name][shipLastName]</td>
<td><input type="text" name="shipLastName" value='Jack li'></td>
<td class="td3">*</td>
</tr>

<tr bgcolor="#ffffff">
<td colspan="3" style="text-align:center;font-weight:bold">[信用卡信息][Credit Card Information]</td>
</tr>
<tr bgcolor="#ffffff">
<td>[信用卡卡号][Card Number][cardNo]</td>
<td><input type="text" name="cardNo" value='4000000000000002'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[信用卡有效期年份][Year of Expire Date][cardExpireYear]format：YYYY</td>
<td><input type="text" name="cardExpireYear" value='2022'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[信用卡有效期月份][Month of Expire Date][cardExpireMonth]format：MM</td>
<td><input type="text" name="cardExpireMonth" value='02'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[信用卡安全码][Security code][cardSecurityCode]</td>
<td><input type="text" name="cardSecurityCode" value='246'></td>
<td class="td3">*</td>
</tr>

<tr bgcolor="#ffffff">
<td colspan="3" style="text-align:center;font-weight:bold">[其他信息][Other Information]</td>
</tr>
<tr bgcolor="#ffffff">
<td>[客户端IP][Customer Client IP][ip]</td>
<td><input type="text" name="ip" value="" id="ip"/></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[交易网址][Shopping Website][webSite]</td>
<td><input type="text" name=webSite value="<?php echo $webSite;?>" ></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[交易返回地址][Return Url][returnURL]</td>
<td><input type="text" name="returnUrl" value="<?php echo $returnUrl;?>"></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[交易异步通知地址][Notify Url][notifyURL]</td>
<td><input type="text" name="notifyUrl" value="<?php echo $returnUrl;?>"></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[浏览器信息][Broser Info][userAgent]</td>
<td><input type="text" name="userAgent" id="userAgent"></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[浏览器语言][Broser Language][acceptLang] </td>
<td><input type="text" name="acceptLang" value='En'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[客户端类型][Broser Language][client] </td>
<td><input type="text" name="client" value='PC'></td>
<td class="td3">*</td>
</tr>
<tr bgcolor="#ffffff">
<td>[持卡人购物留言][Remark][remark]</td>
<td><input type="text" name="remark" value='I want to buy ...'></td>
<td class="td3"></td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="3" align="center">
<input type="submit"value="Submit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="Reset"> 
</td>
</tr>
</table>
</form>
<br/><br/>
</div>
</body>
</html>